//回车回调事件方法
export function enterConfirm(callback){
  document.onkeydown =  function(e) { // 回车提交表单
    // 兼容FF和IE和Opera
    var theEvent = window.event || e;
    var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
    if (code === 13) {
      callback && callback()
    }
  }
}

export function getFavicon(url){
  var qs = url.split('?')[0];
  var arr = qs.split('/');
  return arr[0] + '//' + arr[2] + '/favicon.ico';
}